﻿using ParkingLot6.Strategys;

namespace ParkingLot6
{
    /// <summary>
    /// 停车场的经理
    /// </summary>
    public class ParkingLotManager 
    {
        private IEnumerable<ParkingLot> _parkingLots;
        private readonly IParkable _parkable;
        private readonly ICanChooseParkLot _canChooseParkLot;
        public ParkingLotManager(ICanChooseParkLot canChooseParkLot, IEnumerable<ParkingLot> parkingLots, IParkable parkable)
        {
            _canChooseParkLot = canChooseParkLot;
            _parkingLots = parkingLots;
            _parkable = parkable;
        }

        public ParkingLot ChooseParkLot()
        {
            return _canChooseParkLot.ChooseParkLot(_parkingLots);
        }

        public bool Parking()
        {
            return _parkable.Parking();
        }

        public bool Picking()
        {
            return _parkable.Picking();
        }
    }
}
